home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6287 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: isonews.bbn.hp.com!hpbblb!news
  2. From: Matthias Dittrich <matti>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: ERR with typedef...lvalue
  5. Date: 21 Feb 1996 09:53:35 GMT
  6. Organization: Hewlett-Packard Co.
  7. Message-ID: <4geq2v$jse@hpbblb.bbn.hp.com>
  8. References: <1996Feb15.190109@nyssa.swt.edu>
  9. NNTP-Posting-Host: trabant.bbn.hp.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.07 9000/712)
  14. X-URL: news:1996Feb15.190109@nyssa.swt.edu
  15.  
  16. kv09845@nyssa.swt.edu (They Run, Sheep To The Fold) wrote:
  17. >
  18. >The following is a program I can't seem to get to compile. It keeps giving me
  19. >an error. Would anyone happen to know why. I'm sure it's simple, but then, so
  20. >am I. Any help greatly appreciated.
  21. >
  22. >THE SOURCE CODE:
  23. >----------------
  24. >
  25. >#include <stdio.h>
  26. >
  27. >main ()
  28. >{
  29. >    typedef char STRING[81];
  30. >
  31. >    STRING text, input_line;
  32. >
  33. >    text = "this is the text string";
  34. >    input_line = "this is the input_line string";
  35. text and input_line are arrays, you have to fill them with strcpy:
  36.     strcpy(text, "this is the text string");
  37.     strcpy(input_line, "this is the input_line string");
  38.  
  39. >    
  40. >    printf("%s\n", text);
  41. >    printf("%s\n", input_line);
  42. >    
  43. >}
  44. Good luck,
  45. Matthias
  46.  
  47.